<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="cn.edu.ujn.finallab.dao.Orders"%>
<%@page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>订单查询</title>
<link href="<c:url value="/css/indexOfAdmin.css"/>" rel="stylesheet"
	type="text/css" />
</head>
<body>
	<div class="whole">
		<div class="front"></div>
		<div class="footer"></div>
		<div class="title">
			订&nbsp;单&nbsp;信&nbsp;息&nbsp;表 <span class="return"><a
				href="/finallab/return" onclick="return confirm('返回主页？')"
				style="color: red;">返回主页</a></span>
		</div>
		<div class="filter" style="text-align: center;font-size: 50px;">
			 <div style="display: inline-block">
			<form action="<c:url value="/searchOrder"/>" method="post">
			<span style="font-size: 16px">根据房间号码查询：</span> 
			<input type="text" style="height: 20px; width: 170px" name="number" placeholder="可以为空">
			&nbsp;
			<span style="font-size: 16px">根据住客姓名查询：</span> 
			<input type="text" style="height: 20px; width: 170px" name="name" placeholder="可以为空">
			&nbsp;
			<span style="font-size: 16px">根据入住时间查询：</span> 
			<input type="date" style="height: 20px; width: 170px" name="intime" placeholder="可以为空">
			&nbsp;
			<span style="font-size: 16px">根据离店时间查询：</span> 
			<input type="date" style="height: 20px; width: 170px" name="outtime" placeholder="可以为空">
			<input type="submit" value="筛选" style="width: 50px">
			</form>
		</div>
		<br>
		<div class="info">
		<c:if test="${requestScope.pagemsg.rows.size() == 0}">
			<div class="msg" style="color: red; width: 100%; text-align: center; font-size: 16px; margin-left: -90px; margin-top: 10px">		
				查询结果为空！	
			</div>
		</c:if>
		<c:if test="${requestScope.pagemsg.rows.size() != 0}">	
			<table class="table table-bordered table-striped" border="1">
				<thead>
					<tr>
						<th>订单编号</th>
						<th>订单号码</th>
						<th>入住房间</th>
						<th>入住人姓名</th>
						<th>手机号码</th>
						<th>身份证号</th>
						<th>入住时间</th>
						<th>离开时间</th>
						<th>支付价格</th>
						<th>订单状态</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${requestScope.pagemsg.rows}" var="row">
						<tr>
							<td>${row.id}</td>
							<td>${row.orderNumber}</td>
							<td>${row.roomNumber}</td>
							<td>${row.customerName}</td>
							<td>${row.customerPhone}</td>
							<td>${row.customerIdcard}</td>
							<td>${row.inTime}</td>
							<td>${row.outTime}</td>
							<td>${row.price}</td>
							<td>${row.state}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<div class="page">
			<span>第${requestScope.pagemsg.page}页，共${requestScope.pagemsg.totalpage}页，总订单数：${requestScope.pagemsg.total}</span>
			<span> <c:if test="${requestScope.pagemsg.page != 1}">
					<a
						href="${pageContext.request.contextPath }/allOrder?currentPage=1">[首页]</a>
					<a
						href="${pageContext.request.contextPath }/allOrder?currentPage=${requestScope.pagemsg.page-1}">[上一页]</a>
				</c:if> <c:if
					test="${requestScope.pagemsg.page != requestScope.pagemsg.totalpage}">
					<a
						href="${pageContext.request.contextPath }/allOrder?currentPage=${requestScope.pagemsg.page+1}">[下一页]</a>
					<a
						href="${pageContext.request.contextPath }/allOrder?currentPage=${requestScope.pagemsg.totalpage}">[尾页]</a>
				</c:if>
			</span>
		</div>
		</c:if>
	</div>
</body>
</html>